From b972aa21389c20ab9da1a627612bbc1dafeec366 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 29 Jul 2022 23:40:59 -0700 Subject: dynamic qr lib import and invoice amount param --- src/routes/invoice/[amount].js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/routes/invoice/[amount].js (limited to 'src/routes/invoice/[amount].js') diff --git a/src/routes/invoice/[amount].js b/src/routes/invoice/[amount].js new file mode 100644 index 00000000..f75a1672 --- /dev/null +++ b/src/routes/invoice/[amount].js @@ -0,0 +1,14 @@ +import { post } from '$lib/utils'; + +const username = 'bob', + network = 'lightning'; + +export async function GET({ params }) { + let { amount } = params; + console.log("AMT", amount); + let { text } = await post('/lightning/invoice', { amount }); + console.log("TXT", text); + await post('/invoice', { invoice: { text, network }, user: { username } }); + + return { body: { amount, text } }; +} -- cgit v1.2.3